Release 10.1A: OpenEdge Development:
Progress Dynamics Basic Development
Building a menu structure TreeView window
You can also use the dynamic TreeView layout as a way to represent a menu structure. In this way the hierarchy of your menu, with potentially multiple levels, appears represented as a tree on the left side of your application window. The dynamic windows that are launched from the items in your menu structure are all realized as frames in the panel on the right side of the window, just as you saw in the earlier example.
If these windows in turn launch other separate windows, then these will still appear as separate windows rather than as frames in the TreeView window. You can control this, if you wish, by representing the multiple frames as tabs in a single tab folder rather than as separate windows.
Creating a TreeView window for a menu is essentially the same as creating one for a node representing data.
![]()
To construct a TreeView window for the Administration’s Security menu:
- From the AppBuilder, select Build
Tree Node Control. The node you create will represent the menu structure.
- Enter a Node Code and Description for the node. The example calls the node SecurityNd.
This example has no Parent Node Code. Also, because the menu item label will be displayed as the identifying label for the item in the TreeView, there is no need to enter a Node Label; it will not be displayed.
- For the Data Source Type, select Menu Structure.
- Select the Menu Structure Code for the menu structure you want to represent. In this example, it is ICFAF-Secu, the Administration Security menu.
None of the other fields for the node maintenance apply, except possibly the Image File Names, if you want to use them. At this time, only open and closed folder images are available, and there is not yet a maintenance utility to add images to the Repository. For this example, you can leave the Image File Names blank.
- Choose Save to save this node description.
- Exit the Tree Node Maintenance.
- Exit the Tree Node Object Control.
- From the AppBuilder, select Build
Dynamic TreeView Builder.
- Choose the Add button to display the Dynamic TreeView Builder Maintenance window.
- Select a Product Code and Product Module Code. For the example, you could select the General module of the Sports application, if you have that definition available from your work in OpenEdge Development: Progress Dynamics Getting Started .
- Give the TreeView object a name and enter a description. For the example, use SecurityTree.
- Enter a Window Title to appear at the top of the TreeView window. For the example, it is Progress Dynamics Security.
- Enter the name of the Node Code you assigned in the node maintenance. The example uses SecurityNd.
- Because the example does not use the folder images for the Security node, select Text Only with Tree Lines as the Tree Style.
- Save this information.
- Exit the Dynamic TreeView Builder.
- In the Dynamic TreeView Builder Control, select Options
Generate Dynamic Object, then confirm that you want to save this object and that you want to delete any earlier version of it.
- Exit the Dynamic TreeView Builder.
- Now you can run your Security Menu TreeView, as follows:
Note that no images appear with the items because you defined the TreeView that way. Also, note that the labels of the menu items appear as the labels of the individual items in the tree.
Note: When programming with dynamic treeviews, note that the content of the TreeView sits in a dynamic frame. To get the handle of the TreeView when working with an object within it, get the ContainerSource of the object. This gives you the dynamic frame. Get the ContainerSource of the dynamic frame, and you have the TreeView handle.
|
Copyright © 2005 Progress Software Corporation www.progress.com Voice: (781) 280-4000 Fax: (781) 280-4095 |